package com.fanrenqiji.entity;

import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by yanwt on 2017/1/9.
 */
@Getter
@Setter
@Entity
@Table(name = "tb_we_chat_user")
@org.hibernate.annotations.Table(appliesTo = "tb_we_chat_user",comment = "微信用户")
@org.hibernate.annotations.DynamicInsert
@org.hibernate.annotations.DynamicUpdate
@org.hibernate.annotations.Cache(region="we_chat_user", usage = CacheConcurrencyStrategy.READ_WRITE)
public class WeChatUserEntity extends DataEntity{
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    private Long id;
    @Column(name="open_id",columnDefinition=("varchar(100) default null comment '微信openid'"))
    private String openId;
    @Column(name="union_id",columnDefinition=("varchar(100) default null "))
    private String unionId;
    @Column(name="add_date",columnDefinition="datetime not null ")
    private Timestamp addDate;
    @Column(name="subscribe_time",columnDefinition="datetime not null ")
    private Timestamp subscribeTime;
    private int subscribe;
    @Column(name="nick_name",columnDefinition=("varchar(100) default null "))
    private String nickName;
    private String sex;
    private String language;
    @Column(name="head_img_url",columnDefinition=("varchar(255) default null "))
    private String headImgUrl;
    private String city;
    private String province;
    private String country;
    private String remark;
    @Column(name="group_id",columnDefinition=("varchar(100) default null "))
    private String groupId;
    @Column(name="tagid_list",columnDefinition=("varchar(100) default null "))
    private String tagidList;
    private String name;
    @Column(columnDefinition = ("int(1) not null comment '用户类型 0:未分类 1:家长 2:销售 3:教师'"))
    private int type; //类型

    @Column(columnDefinition=("varchar(50) default null comment '来源'"))
    private String source;

}
